package cn.iocoder.yudao.module.system.wechat_card.dto.create_card;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;

@Data
public class GeneralCardDTO implements Serializable {

    @Schema(description = "卡类型，目前支持 GIFT_CARD 礼品卡 VOUCHER 兑换卡", requiredMode = Schema.RequiredMode.REQUIRED, example = "GIFT_CARD")
    @NotNull(message = "卡类型不能为空")
    private String sub_card_type;

    @Schema(description = "礼品卡背景图片", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String background_pic_url;

    @Schema(description = "基本的卡券数据，见下表，所有卡券通用。", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "基本的卡券数据不能为空")
    private CardBaseInfoDTO base_info;

    @Schema(description = "若卡券为兑换卡，可以设置为图文说明，用于解释商品的详细参数", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private AdvancedInfoDTO advanced_info;

    @Schema(description = "是否支持余额，填写true或者false。默认为false", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否支持余额不能为空")
    private Boolean supply_balance;

    @Schema(description = "prerogative", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "礼品卡享受更多优惠")
    private String prerogative;

    // TODO: 2024/1/3 测试建立会员卡后。报错提示缺少必填字段，
    //激活方式是必填的。
    //但是激活的三个字段不是必填的。MMP
    //这文档在后面加一句也好啊
    //划重点
    //1.填入了自动激活auto_activate字段，激活链接activate_url和一键开卡接口设置都会失效；
    //2.若同时传入了activate_url，则一键开卡接口设置会失效；
    //3.建议开发者activate_url、auto_activate和wx_activate只填写一项。
    @Schema(description = "是否自动激活，若开发者不需要额外激活流程则填写true", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Boolean auto_activate;

    @Schema(description = "activate_url", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String activate_url;

    @Schema(description = "wx_activate", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Boolean wx_activate;


    @Schema(description = "是否支持积分，填写true或者false。默认为false", requiredMode = Schema.RequiredMode.REQUIRED)
    private Boolean supply_bonus;


    @Schema(description = "初始余额，用户购买礼品卡后卡面上显示的初始余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Integer init_balance;

    /**
     * 注意事项：开发者仅能在supply_balance和custom_field1、custom_field2、custom_field3中选择最多3个填写，否则报错。
     */
    @Schema(description = "自定义会员信息类目，会员卡激活后显示,包含name和url字段", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private CustomFieldDTO custom_field1;

    @Schema(description = "自定义会员信息类目，会员卡激活后显示,包含name和url字段", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private CustomFieldDTO custom_field2;


}
